<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>局部组件案例</title>
    <script src="vue.js"></script>
    <style>
        .container{
            width: 1800px;
            margin: 50 auto;
        }
        .item{
            float: left;
            margin: 20px;
            text-align: center;
            font-size: 25px;
            border-radius: 15px;
            background-color: #cccc;
        }
        .item img{
            width: 320px;
            height: 180px;
        }
    </style>
</head>
<body>
    <template id="lessionItemTemplate">
        <div class="item">
            <img src="images/model264 (1).jpg">
            <div>
                <span>SSM框架学习</span>
                <div>翟老师</div>
            </div>
        </div>
    </template>
    <template id="lessionListTemplate">
        <div class="container">
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem>
            <lessionitem></lessionitem> 
       </div>
    </template>
    <div id="app">
        <lessionlist></lessionlist>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        components:{
            'lessionlist':{
                template:'#lessionListTemplate',
                components:{
                    'lessionitem':{
                        template:'#lessionItemTemplate'
                    }
                }
            }
        }
    });
</script>